package com.lee.baseXml;

import com.lee.GreetingsService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

public class Consumer {


    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"consumer.xml"});
        context.start();
        Arrays.stream(context.getBeanDefinitionNames()).forEach(System.out::println);
        GreetingsService greetingsService = context.getBean(GreetingsService.class); // 获取远程服务代理
        String hello = greetingsService.sayHi("world"); // 执行远程方法
        System.out.println(hello); // 显示调用结果

    }


}
